<script>
	document.write("appName : "+navigator.appName+"<br/><br/>");
	document.write("appVersion : "+navigator.appVersion+"<br/><br/>");
	document.write("userAgent : "+navigator.userAgent+"<br/><br/>");
	document.write("Windows : "+/MSIE/.test(navigator.userAgent)+"<br/><br/>");
	document.write("Firefox : "+/Firefox/.test(navigator.userAgent)+"<br/><br/>");
	document.write("Chrome : "+/Chrome/.test(navigator.userAgent)+"<br/><br/>");

	var phNumber = /\d{3}-\d{3}-\d{4}/;   //303-331-9800
	var ticketId = /\w{11}\/[0-9]{2,5}/;   // H4eJ83MjFC0/33
	var trim = /^\s+|\s+$/g; //trimming works in all browsers, if u remove /g then it will not work in 
	var Name = /[A-Z]{1}[a-z]{5,10}/;
	
	function trimVal(val){		
		val = val.replace(trim, '');
		document.getElementById('dd').value=val;
	}

	function testVal(val){
		alert(Name.test(val));
	}
	
	
</script>

<input type='text' id="dd" onclick='testVal(this.value)' size='40'>

<!-- 
http://www.regexlib.com/
http://www.zytrax.com/tech/web/regex.htm
http://www.javascriptkit.com/javatutors/redev3.shtml
 -->

